#include "thread.hpp"
using namespace threadpackaged;

int main()
{
    thread t([](){
        while(true)
        {
            char name[128];
            pthread_getname_np(pthread_self(),name,128);
            std::cout<<"我是一个新线程:"<<name<<std::endl;
        }
    });
    t.start();
    t.detach();

    //t.stop();

    sleep(5);

    t.join();
    return 0;
}